// 将其它数据转换为 bigint 值

// 将 BigInt 当作普通函数使用时，
// 用于将其它数据转换为 bigint 值(原始类型)
// 但是不是所有的数据都可以转换为 bigint

let x ;;

// x = BigInt(); // TypeError: Cannot convert undefined to a BigInt

// x = BigInt( null ); // TypeError: Cannot convert null to a BigInt

// x = BigInt( undefined ); // TypeError: Cannot convert undefined to a BigInt

x = BigInt( 0 );
console.log( x , typeof x );

x = BigInt( '' );
console.log( x , typeof x );

// x = BigInt( NaN ); // TypeError: Cannot convert NaN to a BigInt

x = BigInt( false );
console.log( x , typeof x );

x = BigInt( [ ] );
console.log( x , typeof x );

// x = BigInt( { } ); // SyntaxError: Cannot convert `[object Object]` to a BigInt